//package www.wen.com.common.lib.view.popuview
//
//import android.content.Context
//import android.widget.FrameLayout
//import androidx.core.content.ContextCompat
//import com.bigkoo.pickerview.builder.OptionsPickerBuilder
//import com.bigkoo.pickerview.view.OptionsPickerView
//import com.contrarywind.view.WheelView
//import com.lxj.xpopup.core.BottomPopupView
//import com.lxj.xpopup.util.XPopupUtils
//import www.wen.com.common.R
//import www.wen.com.common.lib.helper.ResultUiCallBack
//
//abstract class BaseBottomSelectPopupView<T>(
//        context: Context,
//        private var optionItems: List<T> = mutableListOf(),
//        private val resultCallBack: ResultUiCallBack<T>? = null,
//) : BottomPopupView(context) {
//
//    var selectItem: T? = null
//
//    private var mIsFirst: Boolean = true
//
//    lateinit var mOptions: OptionsPickerView<T>
//
//    private lateinit var mTimePickerContainer: FrameLayout
//
//    private lateinit var mTimePickerInnerContainer: FrameLayout
//
//    override fun getMaxHeight(): Int = (XPopupUtils.getScreenHeight(context) * 0.45f).toInt()
//
//    override fun onCreate() {
//        super.onCreate()
//        mTimePickerContainer = findViewById(R.id.timePickerContainer)
//        mTimePickerInnerContainer = findViewById(R.id.timePickerInnerContainer)
//
//        mOptions = OptionsPickerBuilder(context) { options1, _, _, _ ->
//            selectItem = optionItems[options1]
//            //如果是第一次则不回调,通常外部已经知道选中的项,避免触发不必要的事件
//            if (!mIsFirst) {
//                mIsFirst = false
//                resultCallBack?.invoke(this@BaseBottomSelectPopupView, selectItem!!, this@BaseBottomSelectPopupView)
//            }
//        }
//                .setLineSpacingMultiplier(provideLineSpacingMultiplier())
//                .setDividerColor(provideDividerColor())
//                .setLayoutRes(R.layout.pickerview_area) {}
//                .setContentTextSize(provideContentTextSize())
//                .setItemVisibleCount(provideItemVisibleCount())
//                .setDecorView(mTimePickerInnerContainer)
//                .setDividerType(provideDividerType())
//                .setOutSideColor(ContextCompat.getColor(context, provideOutSideColor()))
//                .setBgColor(ContextCompat.getColor(context, provideBgColor()))
//                .setTextColorCenter(ContextCompat.getColor(context, provideTextColorCenter()))
//                .build()
//
//
//        mOptions.setPicker(optionItems.toMutableList())
//        mOptions.setSelectOptions(provideSelectOptionIndex())
//        mOptions.show(false)
//        mOptions.returnData()
//    }
//
//    open fun provideSelectOptionIndex(): Int = 0
//
//    open fun provideDividerType(): WheelView.DividerType = WheelView.DividerType.FILL
//
//    open fun provideContentTextSize(): Int = 15
//
//    open fun provideItemVisibleCount(): Int = 12
//
//    open fun provideLineSpacingMultiplier(): Float = 2f
//
//    open fun provideDividerColor(): Int = R.color.colorECECEC
//
//    open fun provideOutSideColor(): Int = R.color.color000000
//
//    open fun provideBgColor(): Int = R.color.colorFFFFFF
//
//    open fun provideTextColorCenter(): Int = R.color.color000000
//
//}